 <tr>
                    <td> 
                    Chọn thư mục
                    <? $HamXuLyChon="showmodule(this.value)";?> 
                    <select name="slimg" id="slimg" onchange="<?=$HamXuLyChon?>" >
                    <option  value="../hinhanh">hinhanh</option>
					<?
$_SESSION[path]=="";
//session_destroy();
if($_SESSION[path]==""){$_SESSION[path]= "../hinhanh";}
$path = $_SESSION[path];
if($url==""){$url="../hinhanh";}
$dirr=$_GET[dirr];
$dirr=str_replace("*",CHR(47),$dirr);
if($dirr!=""){$url=$dirr;}
$webpath ="the url you want to place before your filename/";
$dir_handle = @opendir($path) or die("Unable to open $path");
list_dir($dir_handle,$path,"&nbsp;&nbsp;&nbsp;");
function list_dir($dir_handle,$path)
{
    while (false !== ($file = readdir($dir_handle))) {
        $dir =$path.'/'.$file;
        if(is_dir($dir) && $file != '.' && $file !='..' )
        {
			$duongdan=str_replace(CHR(47),"*",$dir);
            $handle = @opendir($dir) or die("undable to open file $file");
			echo "<option  value=".$duongdan.">".$dir."</option>";
            list_dir($handle, $dir);
        }
    }
    closedir($dir_handle);
}
?></select></td>
                  </tr>
                  <tr>
                    <td>                    
                    <DIV id="txtHint2" style="MARGIN-BOTTOM: 3px" > <? include "image.php"?> </DIV>   
                                     </td>
                  </tr>
                 <script >
			  function showmodule(str)
				{ 
				xmlHttp5=GetXmlHtt5pObject();
				if (xmlHttp5==null)
				  {
				  alert ("Your browser does not support AJAX!");
				  return;
				  } 
				var url="image.php";
				url=url+"?q="+str;
				url=url+"&sid="+Math.random();
				xmlHttp5.onreadystatechange=stateChanged4;
				xmlHttp5.open("GET",url,true);
				xmlHttp5.send(null);
				}function stateChanged4() 
				{ 
				if (xmlHttp5.readyState==4)
				{ 
				document.getElementById("txtHint2").innerHTML=xmlHttp5.responseText;
				}
				}function GetXmlHtt5pObject()
				{
				var xmlHttp5=null;
				try
				  {
				  // Firefox, Opera 8.0+, Safari
				  xmlHttp5=new XMLHttpRequest();
				  }
				catch (e)
				  {
				  // Internet Explorer
				  try
					{
					xmlHttp5=new ActiveXObject("Msxml2.XMLHTTP");
					}
				  catch (e)
					{
					xmlHttp5=new ActiveXObject("Microsoft.XMLHTTP");
					}
				  }
				return xmlHttp5;
				}
              </script>